<template>
  <ul class="lists">
    <li v-for="(item, index) in data" :key="index">
      <router-link :to="{name:'detail', query:{id : item.id}}">
        <div class="list-item">
          <div class="logo">
            <div>
              <img :src="item.thumb || require('../assets/logo.jpg')">
            </div>
          </div>
          <div class="content">
            <div class="title">
              <h3>{{item.title}}</h3>
            </div>
            <div class="desc">
              <p class="nickname">{{item.author}}</p>
              <div class="item">
                <div>
                  <span>{{item.label}}</span>
                  <span><i class="fa fa-eye"></i> {{item.reading}}</span>
                  <span><i class="fa fa-commenting-o"></i> {{item.comment_num}}</span>
                  <span><i class="fa fa-calendar-minus-o"> {{item.add_time}}</i></span></div>
                <img v-if="item.ispay" src="../assets/hongbao.png">
              </div>
            </div>
          </div>
        </div>
      </router-link>
    </li>
  </ul>
</template>

<script>
  export default {
    name: "lists",
    props:['data'],
  }
</script>

<style lang="scss" type="text/scss" scoped>
  li {
    border-bottom: 1px solid #eeeeee;
  }
  .lists {
    margin: 0 5px;
  }

  .list-item {
    display: flex;
    justify-content: start;
    align-items: stretch;
    padding: 10px;
  }

  .logo {
    div {
      width: 70px;
      height: 60px;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin-left: 8px;
    flex-grow: 1;
    .title {
      display: flex;
      h3 {
        font-size: 12px;
        /*line-height: 1.5;*/
      }
    }
    .desc {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      color: #999999;
      font-size: 11px;
      .nickname {
        font-size: inherit;
        margin-bottom: 5px;
      }
      .item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        span {
          margin-right: 2px;
        }
        span:first-child {
          background-color: aqua;
          color: #fff;
        }
      }
      img {
        width: 10px;
        height: 10px;
      }
    }
  }
</style>
